package com.christianposta.learnddd.domain.shared;

public abstract class AbstractSpecification<T> implements Specification<T> {

	public abstract boolean isSatisfiedBy(T t);
	
	public Specification<T> and(Specification<T> specification) {
		return new AndSpecification<T>(this, specification);
	}

	public Specification<T> not(Specification<T> specification) {
		return new NotSpecification<T>(specification);
	}

	public Specification<T> or(Specification<T> specification) {
		return new OrSpecification<T>(this, specification);
	}

}
